package org.example;

/**
 * org.example
 *
 * @author 莫磊
 * @description
 * @date 2025/7/25
 */
import org.example.config.ConfigLoader;
import org.example.entity.Server;
import org.example.test.SpeedTester;

import java.io.IOException;
import java.util.List;

public class Main {
	public static void main(String[] args) {
		String configPath = "C:\\software\\v2rayN-With-Core\\guiConfigs\\configSpeedtest.json";

		try {
			List<Server> servers = ConfigLoader.loadSocksServers(configPath);

			for (Server server : servers) {
				System.out.printf("Testing %s:%d%n", server.getAddress(), server.getPort());
				int latency = SpeedTester.testProxySpeed(server.getAddress(), server.getPort());
				System.out.printf("Latency: %d ms%n", latency);
			}

		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}